import { createStore, applyMiddleware } from 'redux';

import reduxLogger from 'redux-logger';
import reduxThunk from 'redux-thunk';
import reduxPromise from 'redux-promise';
import reducer from './reducer';



let applyArr = [reduxThunk, reduxPromise];

if (currentEnv == 'development') { // webpack.config.js 配置全局 解决process is not defined
    applyArr.push(reduxLogger)
}


const store = createStore(
    reducer,
    applyMiddleware(...applyArr)
    // applyMiddleware()
)
export default store